<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>JSON</title>
		
	</head>
	<body>
		<h1>JSON对象创建</h1>
		<script type="text/javascript">
			person={
				name:'jack',
				age:20,
				addr:{
					homeAddr:'海南海口市',
					workAddr:'海口秀英区'
				}
			};//花括号：对象（属性）//
			alert(person.name);
			alert(person['age']);//想取得对象属性值的两种方式//
			alert(person.addr.homeAddr);
			
			students=[
				{name:'lmy',age:20},
				{name:'mjq',age:18},
			];
			alert(students[1].age)
			
			s={
				'sites':[
				 {"name":"菜鸟教程","url":"www.runoob.com"},
				 { "name":"google","url":"www.google.com" }, 
    			 { "name":"微博","url":"www.weibo.com" }
				]
			}
		</script>
	</body>
</html>
